<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
  <title>Draw lines rendered with WebGL</title>
  <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css"
    crossorigin="anonymous">
  <link rel="stylesheet" type="text/css"
    href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.2/css/fontawesome.min.css"
    crossorigin="anonymous">
  <link rel="stylesheet" type="text/css"
    href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.2/css/solid.css" crossorigin="anonymous">
  <link rel="stylesheet" type="text/css"
    href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.2/css/brands.css" crossorigin="anonymous">
  <link rel="stylesheet" type="text/css" href="./theme/ol.css">
  <link rel="stylesheet" type="text/css" href="/theme/site.css">
  <link rel="stylesheet" type="text/css" href="webgl-draw-line.css">
  <link rel="icon" type="image/svg+xml" href="/theme/img/logo-light.svg" media="(prefers-color-scheme: light)" />
  <link rel="icon" type="image/svg+xml" href="/theme/img/logo-dark.svg" media="(prefers-color-scheme: dark)" />
</head>

<body>
  <header class="navbar navbar-expand-md navbar-dark mb-3 px-3 py-0 fixed-top" role="navigation">
    <a class="navbar-brand" href="/"><img src="/theme/img/logo-dark.svg" width="70" height="70"
        alt="">&nbsp;OpenLayers</a>
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#olmenu"
      aria-controls="olmenu" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

    <!-- menu items that get hidden below 768px width -->
    <nav class="collapse navbar-collapse" id="olmenu">
      <ul class="nav navbar-nav ms-auto">
        <li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle" href="#" id="docdropdown" role="button" data-bs-toggle="dropdown"
            aria-haspopup="true" aria-expanded="false">Docs</a>
          <div class="dropdown-menu dropdown-menu-end mb-3" aria-labelledby="docdropdown">
            <a class="dropdown-item" href="/doc/">Docs</a>
            <div class="dropdown-divider"></div>
            <a class="dropdown-item" href="/doc/quickstart.html"><i class="fa fa-check fa-fw me-2 fa-lg"></i>快速入门</a>
            <a class="dropdown-item" href="/doc/faq.html"><i class="fa fa-question fa-fw me-2 fa-lg"></i>常见问题</a>
            <a class="dropdown-item" href="/doc/tutorials/"><i class="fa fa-book fa-fw me-2 fa-lg"></i>教程</a>

          </div>
        </li>
        <li class="nav-item"><a class="nav-link" href="/en/latest/examples/">Examples</a></li>
        <li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle" href="#" id="apidropdown" role="button" data-bs-toggle="dropdown"
            aria-haspopup="true" aria-expanded="false">
            <i class="fa fa-sitemap me-1"></i>API
          </a>
          <div class="dropdown-menu dropdown-menu-end mb-3" aria-labelledby="apidropdown">
            <a class="dropdown-item" href="/en/latest/apidoc/"><i class="fa fa-sitemap fa-fw me-2 fa-lg"></i>v8.2.0
              (latest)</a </div>
        </li>
      </ul>
    </nav>
  </header>

  <div class="container-fluid line-numbers">
    <div id="latest-check" class="alert alert-warning alert-dismissible" role="alert" style="display:none">
      <button id="latest-dismiss" type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
      This example uses OpenLayers v<span>8.2.0</span>. The <a id="latest-link" href="#" class="alert-link">latest</a>
      is v<span id="latest-version"></span>.
    </div>


    <div class="row-fluid">
      <a href="#" id="codepen-button" class="btn btn-link float-end">
        <i class="fab fa-codepen fa-lg"></i> Edit
      </a>
      <div class="span12">
        <h4 id="title">绘制使用 WebGL 渲染的线条</h4>
        <p class="tags">
          <span class="badge-group">
            <a href="./index.html?q=draw" class="badge badge-info">draw</a><a class="badge badge-info tag-modal-toggle"
              data-bs-toggle="modal" data-bs-target="#tag-example-list" data-title="draw" data-content="&lt;ul class=&quot;list-group&quot;&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./draw-and-modify-features.html&quot;&gt;Draw and Modify Features&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./draw-and-modify-geodesic.html&quot;&gt;Draw and Modify Geodesic Circles&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./draw-features.html&quot;&gt;Draw Features&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action active&quot; href=&quot;./webgl-draw-line.html&quot;&gt;Draw lines rendered with WebGL&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./draw-shapes.html&quot;&gt;Draw Shapes&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./draw-features-style.html&quot;&gt;Drawing Features Style&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./draw-freehand.html&quot;&gt;Freehand Drawing&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./line-arrows.html&quot;&gt;LineString Arrows&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./measure.html&quot;&gt;Measure&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./measure-style.html&quot;&gt;Measure using vector styles&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./modify-scale-and-rotate.html&quot;&gt;Scale and Rotate using Modify Interaction&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./snap.html&quot;&gt;Snap Interaction&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./topolis.html&quot;&gt;topolis integration&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./tracing.html&quot;&gt;Tracing around a polygon&lt;/a&gt;
                  &lt;/ul&gt;" tabindex="0">14</a>
          </span>
          <span class="badge-group">
            <a href="./index.html?q=vector" class="badge badge-info">vector</a><a
              class="badge badge-info tag-modal-toggle" data-bs-toggle="modal" data-bs-target="#tag-example-list"
              data-title="vector" data-content="&lt;ul class=&quot;list-group&quot;&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./mapbox-vector-tiles-advanced.html&quot;&gt;Advanced Mapbox Vector Tiles&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./animated-gif.html&quot;&gt;Animated GIF&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./vector-esri.html&quot;&gt;ArcGIS REST Feature Service&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cluster.html&quot;&gt;Clustered Features&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./feature-animation.html&quot;&gt;Custom Animation&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./custom-circle-render.html&quot;&gt;Custom Circle Render&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./custom-hit-detection-renderer.html&quot;&gt;Custom Hit Detection Render&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./custom-interactions.html&quot;&gt;Custom Interactions&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./polygon-styles.html&quot;&gt;Custom Polygon Styles&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./declutter-group.html&quot;&gt;Declutter Group&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./drag-and-drop-image-vector.html&quot;&gt;Drag-and-Drop Image Vector&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./draw-and-modify-features.html&quot;&gt;Draw and Modify Features&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./draw-and-modify-geodesic.html&quot;&gt;Draw and Modify Geodesic Circles&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./draw-features.html&quot;&gt;Draw Features&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action active&quot; href=&quot;./webgl-draw-line.html&quot;&gt;Draw lines rendered with WebGL&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./draw-shapes.html&quot;&gt;Draw Shapes&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./clusters-dynamic.html&quot;&gt;Dynamic clusters&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./earthquake-clusters.html&quot;&gt;Earthquake Clusters&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./heatmap-earthquakes.html&quot;&gt;Earthquakes Heatmap&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./kml-earthquakes.html&quot;&gt;Earthquakes in KML&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./earthquake-custom-symbol.html&quot;&gt;Earthquakes with custom symbols&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./vector-esri-edit.html&quot;&gt;Editable ArcGIS REST Feature Service&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./flight-animation.html&quot;&gt;Flight Animation&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./fractal.html&quot;&gt;Fractal Rendering&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./draw-freehand.html&quot;&gt;Freehand Drawing&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./geojson.html&quot;&gt;GeoJSON&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./geojson-vt.html&quot;&gt;geojson-vt integration&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./icon-scale.html&quot;&gt;Icon and Label Scale&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./icon-color.html&quot;&gt;Icon Colors&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./modify-icon.html&quot;&gt;Icon modification&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./icon-negative.html&quot;&gt;Icon Pixel Operations&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./icon.html&quot;&gt;Icon Symbolizer&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./icon-width.html&quot;&gt;Icon Symbolizer width and height&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./jsts.html&quot;&gt;JSTS Integration&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./line-arrows.html&quot;&gt;LineString Arrows&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./mapbox-vector-layer.html&quot;&gt;Mapbox Vector Layer&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./mapbox-vector-tiles.html&quot;&gt;Mapbox Vector Tiles&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./mapbox-layer.html&quot;&gt;Mapbox-gl Layer&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./measure.html&quot;&gt;Measure&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./measure-style.html&quot;&gt;Measure using vector styles&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./modify-features.html&quot;&gt;Modify Features&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./modify-test.html&quot;&gt;Modify Features Test&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./ogc-vector-tiles.html&quot;&gt;OGC Vector Tiles&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./osm-vector-tiles.html&quot;&gt;OSM Vector Tiles&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./vector-osm.html&quot;&gt;OSM XML&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./populated-places.html&quot;&gt;Populated Places&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./regularshape.html&quot;&gt;Regular Shapes&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./rich-text-labels.html&quot;&gt;Rich Text Labels&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./modify-scale-and-rotate.html&quot;&gt;Scale and Rotate using Modify Interaction&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./select-features.html&quot;&gt;Select Features&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./select-hover-features.html&quot;&gt;Select Features by Hover&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./select-multiple-features.html&quot;&gt;Select multiple Features&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./snap.html&quot;&gt;Snap Interaction&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./street-labels.html&quot;&gt;Street Labels&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./style-expressions.html&quot;&gt;Style Expressions&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./style-renderer.html&quot;&gt;Style renderer&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./synthetic-lines.html&quot;&gt;Synthetic Lines&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./synthetic-points.html&quot;&gt;Synthetic Points&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./kml-timezones.html&quot;&gt;Timezones in KML&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./tooltip-on-hover.html&quot;&gt;Tooltip on Hover&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./topojson.html&quot;&gt;TopoJSON&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./topolis.html&quot;&gt;topolis integration&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./tracing.html&quot;&gt;Tracing around a polygon&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./translate-features.html&quot;&gt;Translate Features&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./turf.html&quot;&gt;turf.js&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./layer-clipping-vector.html&quot;&gt;Vector Clipping Layer&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./image-vector-layer.html&quot;&gt;Vector Image Layer&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./vector-label-decluttering.html&quot;&gt;Vector Label Decluttering&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./vector-labels.html&quot;&gt;Vector Labels&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./vector-labels-justify-text.html&quot;&gt;Vector Labels - Justify Text&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./vector-layer.html&quot;&gt;Vector Layer&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./hitdetect-vector.html&quot;&gt;Vector Layer Hit Detection&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./webgl-vector-layer.html&quot;&gt;WebGL Vector Layer&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./webgl-vector-tiles.html&quot;&gt;WebGL Vector Tiles Layer&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./vector-wfs.html&quot;&gt;WFS&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./vector-wfs-getfeature.html&quot;&gt;WFS - GetFeature&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./vector-wfs-geographic.html&quot;&gt;WFS with geographic coordinates&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./wind-arrows.html&quot;&gt;Wind Arrows&lt;/a&gt;
                  &lt;/ul&gt;" tabindex="0">78</a>
          </span>
          <span class="badge-group">
            <a href="./index.html?q=webgl" class="badge badge-info">webgl</a><a
              class="badge badge-info tag-modal-toggle" data-bs-toggle="modal" data-bs-target="#tag-example-list"
              data-title="webgl" data-content="&lt;ul class=&quot;list-group&quot;&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-stretch.html&quot;&gt;Band Contrast Stretch&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./cog-style.html&quot;&gt;Change Tile Layer Style&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action active&quot; href=&quot;./webgl-draw-line.html&quot;&gt;Draw lines rendered with WebGL&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./heatmap-earthquakes.html&quot;&gt;Earthquakes Heatmap&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./filter-points-webgl.html&quot;&gt;Filtering features with WebGL&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./geotiff-reprojection.html&quot;&gt;GeoTIFF Reprojection&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./icon-sprite-webgl.html&quot;&gt;Icon Sprites with WebGL&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./webgl-layer-swipe.html&quot;&gt;Layer Swipe (WebGL)&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./multiple-cogs.html&quot;&gt;Multiple COG sources&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./numpytile.html&quot;&gt;Rendering 16-bit NumpyTiles&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./webgl-sea-level.html&quot;&gt;Sea Level (with WebGL)&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./webgl-shaded-relief.html&quot;&gt;Shaded Relief (with WebGL)&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./webgl-points-layer.html&quot;&gt;WebGL points layer&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./webgl-tile-style.html&quot;&gt;WebGL Tile Layer Styles&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./webgl-tiles.html&quot;&gt;WebGL Tiles&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./webgl-vector-layer.html&quot;&gt;WebGL Vector Layer&lt;/a&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action&quot; href=&quot;./webgl-vector-tiles.html&quot;&gt;WebGL Vector Tiles Layer&lt;/a&gt;
                  &lt;/ul&gt;" tabindex="0">17</a>
          </span>
          <span class="badge-group">
            <a href="./index.html?q=line" class="badge badge-info">line</a><a class="badge badge-info tag-modal-toggle"
              data-bs-toggle="modal" data-bs-target="#tag-example-list" data-title="line" data-content="&lt;ul class=&quot;list-group&quot;&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action active&quot; href=&quot;./webgl-draw-line.html&quot;&gt;Draw lines rendered with WebGL&lt;/a&gt;
                  &lt;/ul&gt;" tabindex="0">1</a>
          </span>
          <span class="badge-group">
            <a href="./index.html?q=dash" class="badge badge-info">dash</a><a class="badge badge-info tag-modal-toggle"
              data-bs-toggle="modal" data-bs-target="#tag-example-list" data-title="dash" data-content="&lt;ul class=&quot;list-group&quot;&gt;
                  &lt;li&gt;&lt;a class=&quot;list-group-item list-group-item-action active&quot; href=&quot;./webgl-draw-line.html&quot;&gt;Draw lines rendered with WebGL&lt;/a&gt;
                  &lt;/ul&gt;" tabindex="0">1</a>
          </span>
        </p>
        <div class="modal modal-tag-example" id="tag-example-list" tabindex="-1" role="dialog"
          aria-labelledby="tag-example-title" aria-hidden="true">
          <div class="modal-dialog modal-dialog-scrollable" role="document">
            <div class="modal-content">
              <div class="modal-header">
                <h5 class="modal-title" id="tag-example-title"></h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
              </div>
              <div class="modal-body">
                <div class="list-group"></div>
              </div>
            </div>
          </div>
        </div>
        <div id="map" class="map"></div>
        <form>
          <div class="form-group">封口类型 &nbsp;
            <label class="radio-inline">
              <input type="radio" class="uniform" name="capType" value="butt" checked /> <code>butt</code>&nbsp;
            </label>
            <label class="radio-inline">
              <input type="radio" class="uniform" name="capType" value="round" /> <code>圆弧(round)</code>&nbsp;
            </label>
            <label class="radio-inline">
              <input type="radio" class="uniform" name="capType" value="square" /> <code>方的(square)</code>&nbsp;
            </label>
          </div>
          <div class="form-group">联接类型 &nbsp;
            <label class="radio-inline">
              <input type="radio" class="uniform" name="joinType" value="miter" checked /> <code>斜接(miter)</code>&nbsp;
            </label>
            <label class="radio-inline">
              <input type="radio" class="uniform" name="joinType" value="round" /> <code>round</code>&nbsp;
            </label>
            <label class="radio-inline">
              <input type="radio" class="uniform" name="joinType" value="bevel" /> <code>斜面(bevel)</code>&nbsp;
            </label>
          </div>
          <div class="form-group">
            <label>
              线宽 (像素)
              <input type="range" class="uniform" name="width" min="1" max="40" value="8">
            </label>
            <span id="value-width">12</span>
          </div>
          <div class="form-group">
            <label>
              斜接极限 (ratio)
              <input type="range" class="uniform" name="miterLimit" min="1" max="20" value="10" step="0.1">
            </label>
            <span id="value-miterLimit">10</span>
          </div>
          <div class="form-group">
            <label>
              线偏移量 (pixels)
              <input type="range" class="uniform" name="offset" min="-40" max="40" value="0">
            </label>
            <span id="value-offset">0</span>
          </div>
          <div class="form-group">
            <label>
              <input type="checkbox" class="rebuild" id="dashEnable">
              虚线
            </label>
          </div>
          <div class="form-group" style="margin-left: 18px">
            <label>
              虚线图案(px)
              <input type="number" class="uniform" name="dashLength1" min="0" max="100" value="25">
              <input type="number" class="uniform" name="dashLength2" min="0" max="100" value="15">
              <input type="number" class="uniform" name="dashLength3" min="0" max="100" value="15">
              <input type="number" class="uniform" name="dashLength4" min="0" max="100" value="15">
            </label>
          </div>
          <div class="form-group" style="margin-left: 18px">
            <label>
              虚线偏移量(pixels)
              <input type="range" class="uniform" name="dashOffset" min="-200" max="200" value="0">
            </label>
            <span id="value-dashOffset">0</span>
          </div>
          <div class="form-group">
            <label>
              <input type="checkbox" class="rebuild" id="patternEnable">
              图像图案
            </label>
          </div>
          <div class="form-group" style="margin-left: 18px">
            <label>
              图案间隔 (pixels)
              <input type="range" class="uniform" name="patternSpacing" min="0" max="64" value="0">
            </label>
            <span id="value-patternSpacing">0</span>
          </div>
        </form>

      </div>
      <form method="POST" id="codepen-form" target="_blank" action="https://codesandbox.io/api/v1/sandboxes/define">
        <input id="codesandbox-params" type="hidden" name="parameters">
      </form>
    </div>

    <div class="row-fluid">
      <div class="span12">
        <p id="shortdesc">Example showing how stroke styling options are represented with the WebGL renderer</p>
        <div id="docs">
          <p>此示例允许您动态调整描边样式选项，以查看它们如何影响线条渲染。默认显示的线条可以通过单击地图进行修改，并可以绘制新的线条。
          </p>
        </div>
      </div>
    </div>

    <div class="row-fluid">
      <h5 class="source-heading">main.js</h5>
      <pre><code id="example-js-source" class="language-js">import GeoJSON from &#x27;ol/format/GeoJSON.js&#x27;;
import Layer from &#x27;ol/layer/Layer.js&#x27;;
import Map from &#x27;ol/Map.js&#x27;;
import View from &#x27;ol/View.js&#x27;;
import WebGLVectorLayerRenderer from &#x27;ol/renderer/webgl/VectorLayer.js&#x27;;
import {Draw, Modify, Snap} from &#x27;ol/interaction.js&#x27;;
import {OSM, Vector as VectorSource} from &#x27;ol/source.js&#x27;;
import {Tile as TileLayer} from &#x27;ol/layer.js&#x27;;
import {fromLonLat} from &#x27;ol/proj.js&#x27;;

/**
 * @type {import(&#x27;ol/style/webgl.js&#x27;).WebGLStyle}
 */
let style;

class WebGLLayer extends Layer {
  createRenderer() {
    return new WebGLVectorLayerRenderer(this, {
      className: this.getClassName(),
      style,
    });
  }
}

const source &#x3D; new VectorSource({
  url: &#x27;data/geojson/switzerland.geojson&#x27;,
  format: new GeoJSON(),
});

/**
 * @param {boolean} dash Include line dash
 * @param {boolean} pattern Include image pattern
 * @return {import(&#x27;ol/style/webgl.js&#x27;).WebGLStyle} Generated style
 */
const getStyle &#x3D; (dash, pattern) &#x3D;&gt; {
  let newStyle &#x3D; {
    variables: style
      ? style.variables
      : {
          width: 12,
          offset: 0,
          capType: &#x27;butt&#x27;,
          joinType: &#x27;miter&#x27;,
          miterLimit: 10, // ratio
          dashLength1: 25,
          dashLength2: 15,
          dashLength3: 15,
          dashLength4: 15,
          dashOffset: 0,
          patternSpacing: 0,
        },
    &#x27;stroke-width&#x27;: [&#x27;var&#x27;, &#x27;width&#x27;],
    &#x27;stroke-color&#x27;: &#x27;rgba(24,86,34,0.7)&#x27;,
    &#x27;stroke-offset&#x27;: [&#x27;var&#x27;, &#x27;offset&#x27;],
    &#x27;stroke-miter-limit&#x27;: [&#x27;var&#x27;, &#x27;miterLimit&#x27;],
    &#x27;stroke-line-cap&#x27;: [&#x27;var&#x27;, &#x27;capType&#x27;],
    &#x27;stroke-line-join&#x27;: [&#x27;var&#x27;, &#x27;joinType&#x27;],
  };
  if (dash) {
    newStyle &#x3D; {
      ...newStyle,
      &#x27;stroke-line-dash&#x27;: [
        [&#x27;var&#x27;, &#x27;dashLength1&#x27;],
        [&#x27;var&#x27;, &#x27;dashLength2&#x27;],
        [&#x27;var&#x27;, &#x27;dashLength3&#x27;],
        [&#x27;var&#x27;, &#x27;dashLength4&#x27;],
      ],
      &#x27;stroke-line-dash-offset&#x27;: [&#x27;var&#x27;, &#x27;dashOffset&#x27;],
    };
  }
  if (pattern) {
    delete newStyle[&#x27;stroke-color&#x27;];
    newStyle &#x3D; {
      ...newStyle,
      &#x27;stroke-pattern-src&#x27;: &#x27;data/dot.svg&#x27;,
      &#x27;stroke-pattern-spacing&#x27;: [&#x27;var&#x27;, &#x27;patternSpacing&#x27;],
    };
  }
  return newStyle;
};

style &#x3D; getStyle(false, false);

let vector &#x3D; new WebGLLayer({
  source,
});

const map &#x3D; new Map({
  layers: [
    new TileLayer({
      source: new OSM(),
    }),
    vector,
  ],
  target: &#x27;map&#x27;,
  view: new View({
    center: fromLonLat([8.43, 46.82]),
    zoom: 7,
  }),
});

const rebuildStyle &#x3D; () &#x3D;&gt; {
  const dash &#x3D; document.getElementById(&#x27;dashEnable&#x27;).checked;
  const pattern &#x3D; document.getElementById(&#x27;patternEnable&#x27;).checked;
  style &#x3D; getStyle(dash, pattern);
  map.removeLayer(vector);
  vector &#x3D; new WebGLLayer({
    source,
  });
  map.addLayer(vector);
};

const modify &#x3D; new Modify({source: source});
map.addInteraction(modify);

let draw, snap; // global so we can remove them later

function addInteractions() {
  draw &#x3D; new Draw({
    source: source,
    type: &#x27;LineString&#x27;,
  });
  map.addInteraction(draw);
  snap &#x3D; new Snap({source: source});
  map.addInteraction(snap);
}

addInteractions();

const inputListener &#x3D; (event) &#x3D;&gt; {
  const variables &#x3D; style.variables;
  const variableName &#x3D; event.target.name;
  if (event.target.type &#x3D;&#x3D;&#x3D; &#x27;radio&#x27;) {
    variables[variableName] &#x3D; event.target.value;
  } else {
    variables[variableName] &#x3D; parseFloat(event.target.value);
  }
  const valueSpan &#x3D; document.getElementById(&#x60;value-${variableName}&#x60;);
  if (valueSpan) {
    valueSpan.textContent &#x3D; variables[variableName];
  }
  map.render();
};
document
  .querySelectorAll(&#x27;input.uniform&#x27;)
  .forEach((input) &#x3D;&gt; input.addEventListener(&#x27;input&#x27;, inputListener));
document
  .querySelectorAll(&#x27;input.rebuild&#x27;)
  .forEach((input) &#x3D;&gt; input.addEventListener(&#x27;input&#x27;, rebuildStyle));
</code></pre>
    </div>

    <div class="row-fluid">
      <h5 class="source-heading">index.html</h5>
      <pre><code id="example-html-source" class="language-markup">&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;Draw lines rendered with WebGL&lt;/title&gt;
    &lt;link rel="stylesheet" href="node_modules/ol/ol.css"&gt;
    &lt;style&gt;
      .map {
        width: 100%;
        height: 400px;
      }
      .form-group label {
        display: flex;
        align-items: center;
        gap: 6px;
        height: 30px;
      }
      .form-group {
        display: flex;
        align-items: center;
        gap: 6px;
      }
    &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div id&#x3D;&quot;map&quot; class&#x3D;&quot;map&quot;&gt;&lt;/div&gt;
    &lt;form&gt;
      &lt;div class&#x3D;&quot;form-group&quot;&gt;Cap type &amp;nbsp;
        &lt;label class&#x3D;&quot;radio-inline&quot;&gt;
          &lt;input type&#x3D;&quot;radio&quot; class&#x3D;&quot;uniform&quot; name&#x3D;&quot;capType&quot; value&#x3D;&quot;butt&quot; checked/&gt; &lt;code&gt;butt&lt;/code&gt;&amp;nbsp;
        &lt;/label&gt;
        &lt;label class&#x3D;&quot;radio-inline&quot;&gt;
          &lt;input type&#x3D;&quot;radio&quot; class&#x3D;&quot;uniform&quot; name&#x3D;&quot;capType&quot; value&#x3D;&quot;round&quot;/&gt; &lt;code&gt;round&lt;/code&gt;&amp;nbsp;
        &lt;/label&gt;
        &lt;label class&#x3D;&quot;radio-inline&quot;&gt;
          &lt;input type&#x3D;&quot;radio&quot; class&#x3D;&quot;uniform&quot; name&#x3D;&quot;capType&quot; value&#x3D;&quot;square&quot;/&gt; &lt;code&gt;square&lt;/code&gt;&amp;nbsp;
        &lt;/label&gt;
      &lt;/div&gt;
      &lt;div class&#x3D;&quot;form-group&quot;&gt;Join type &amp;nbsp;
        &lt;label class&#x3D;&quot;radio-inline&quot;&gt;
          &lt;input type&#x3D;&quot;radio&quot; class&#x3D;&quot;uniform&quot; name&#x3D;&quot;joinType&quot; value&#x3D;&quot;miter&quot; checked/&gt; &lt;code&gt;miter&lt;/code&gt;&amp;nbsp;
        &lt;/label&gt;
        &lt;label class&#x3D;&quot;radio-inline&quot;&gt;
          &lt;input type&#x3D;&quot;radio&quot; class&#x3D;&quot;uniform&quot; name&#x3D;&quot;joinType&quot; value&#x3D;&quot;round&quot;/&gt; &lt;code&gt;round&lt;/code&gt;&amp;nbsp;
        &lt;/label&gt;
        &lt;label class&#x3D;&quot;radio-inline&quot;&gt;
          &lt;input type&#x3D;&quot;radio&quot; class&#x3D;&quot;uniform&quot; name&#x3D;&quot;joinType&quot; value&#x3D;&quot;bevel&quot;/&gt; &lt;code&gt;bevel&lt;/code&gt;&amp;nbsp;
        &lt;/label&gt;
      &lt;/div&gt;
      &lt;div class&#x3D;&quot;form-group&quot;&gt;
        &lt;label&gt;
          Line width (pixels)
          &lt;input type&#x3D;&quot;range&quot; class&#x3D;&quot;uniform&quot; name&#x3D;&quot;width&quot; min&#x3D;&quot;1&quot; max&#x3D;&quot;40&quot; value&#x3D;&quot;8&quot;&gt;
        &lt;/label&gt;
        &lt;span id&#x3D;&quot;value-width&quot;&gt;12&lt;/span&gt;
      &lt;/div&gt;
      &lt;div class&#x3D;&quot;form-group&quot;&gt;
        &lt;label&gt;
          Miter limit (ratio)
          &lt;input type&#x3D;&quot;range&quot; class&#x3D;&quot;uniform&quot; name&#x3D;&quot;miterLimit&quot; min&#x3D;&quot;1&quot; max&#x3D;&quot;20&quot; value&#x3D;&quot;10&quot; step&#x3D;&quot;0.1&quot;&gt;
        &lt;/label&gt;
        &lt;span id&#x3D;&quot;value-miterLimit&quot;&gt;10&lt;/span&gt;
      &lt;/div&gt;
      &lt;div class&#x3D;&quot;form-group&quot;&gt;
        &lt;label&gt;
          Line offset (pixels)
          &lt;input type&#x3D;&quot;range&quot; class&#x3D;&quot;uniform&quot; name&#x3D;&quot;offset&quot; min&#x3D;&quot;-40&quot; max&#x3D;&quot;40&quot; value&#x3D;&quot;0&quot;&gt;
        &lt;/label&gt;
        &lt;span id&#x3D;&quot;value-offset&quot;&gt;0&lt;/span&gt;
      &lt;/div&gt;
      &lt;div class&#x3D;&quot;form-group&quot;&gt;
        &lt;label&gt;
          &lt;input type&#x3D;&quot;checkbox&quot; class&#x3D;&quot;rebuild&quot; id&#x3D;&quot;dashEnable&quot;&gt;
          Enable dashes
        &lt;/label&gt;
        &lt;/div&gt;
      &lt;div class&#x3D;&quot;form-group&quot; style&#x3D;&quot;margin-left: 18px&quot;&gt;
        &lt;label&gt;
          Line dash pattern (px)
          &lt;input type&#x3D;&quot;number&quot; class&#x3D;&quot;uniform&quot; name&#x3D;&quot;dashLength1&quot; min&#x3D;&quot;0&quot; max&#x3D;&quot;100&quot; value&#x3D;&quot;25&quot;&gt;
          &lt;input type&#x3D;&quot;number&quot; class&#x3D;&quot;uniform&quot; name&#x3D;&quot;dashLength2&quot; min&#x3D;&quot;0&quot; max&#x3D;&quot;100&quot; value&#x3D;&quot;15&quot;&gt;
          &lt;input type&#x3D;&quot;number&quot; class&#x3D;&quot;uniform&quot; name&#x3D;&quot;dashLength3&quot; min&#x3D;&quot;0&quot; max&#x3D;&quot;100&quot; value&#x3D;&quot;15&quot;&gt;
          &lt;input type&#x3D;&quot;number&quot; class&#x3D;&quot;uniform&quot; name&#x3D;&quot;dashLength4&quot; min&#x3D;&quot;0&quot; max&#x3D;&quot;100&quot; value&#x3D;&quot;15&quot;&gt;
        &lt;/label&gt;
      &lt;/div&gt;
      &lt;div class&#x3D;&quot;form-group&quot; style&#x3D;&quot;margin-left: 18px&quot;&gt;
        &lt;label&gt;
          Line dash offset (pixels)
          &lt;input type&#x3D;&quot;range&quot; class&#x3D;&quot;uniform&quot; name&#x3D;&quot;dashOffset&quot; min&#x3D;&quot;-200&quot; max&#x3D;&quot;200&quot; value&#x3D;&quot;0&quot;&gt;
        &lt;/label&gt;
        &lt;span id&#x3D;&quot;value-dashOffset&quot;&gt;0&lt;/span&gt;
      &lt;/div&gt;
      &lt;div class&#x3D;&quot;form-group&quot;&gt;
        &lt;label&gt;
          &lt;input type&#x3D;&quot;checkbox&quot; class&#x3D;&quot;rebuild&quot; id&#x3D;&quot;patternEnable&quot;&gt;
          Enable image pattern
        &lt;/label&gt;
      &lt;/div&gt;
      &lt;div class&#x3D;&quot;form-group&quot; style&#x3D;&quot;margin-left: 18px&quot;&gt;
        &lt;label&gt;
          Pattern spacing (pixels)
          &lt;input type&#x3D;&quot;range&quot; class&#x3D;&quot;uniform&quot; name&#x3D;&quot;patternSpacing&quot; min&#x3D;&quot;0&quot; max&#x3D;&quot;64&quot; value&#x3D;&quot;0&quot;&gt;
        &lt;/label&gt;
        &lt;span id&#x3D;&quot;value-patternSpacing&quot;&gt;0&lt;/span&gt;
      &lt;/div&gt;
    &lt;/form&gt;

    &lt;script type="module" src="main.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
&lt;/html&gt;</code></pre>
    </div>

    <div class="row-fluid">
      <h5 class="source-heading">package.json</h5>
      <pre><code id="example-pkg-source" class="language-json">{
  &quot;name&quot;: &quot;webgl-draw-line&quot;,
  &quot;dependencies&quot;: {
    &quot;ol&quot;: &quot;8.2.0&quot;
  },
  &quot;devDependencies&quot;: {
    &quot;vite&quot;: &quot;^3.2.3&quot;
  },
  &quot;scripts&quot;: {
    &quot;start&quot;: &quot;vite&quot;,
    &quot;build&quot;: &quot;vite build&quot;
  }
}</code></pre>
    </div>
  </div>

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js"></script>
  <script src="common.js"></script>
  <script src="webgl-draw-line.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.28.0/components/prism-core.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.28.0/plugins/autoloader/prism-autoloader.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.28.0/plugins/toolbar/prism-toolbar.min.js"></script>
  <script
    src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.28.0/plugins/copy-to-clipboard/prism-copy-to-clipboard.js"></script>
  <script src="./resources/common.js"></script>
  <script>
    document.getElementById('tag-example-list')
      .addEventListener('show.bs.modal', function (event) {
        const button = event.relatedTarget; // Button that triggered the modal
        this.querySelector('.modal-title').innerText = button.dataset.title;
        this.querySelector('.modal-body').innerHTML = button.dataset.content;
      });
  </script>
  <script>
    const releaseUrl = 'https://cdn.jsdelivr.net/npm/ol/package.json';
    fetch(releaseUrl).then(function (response) {
      return response.json();
    }).then(function (json) {
      const latestVersion = json.version;
      document.getElementById('latest-version').innerHTML = latestVersion;
      const url = window.location.href;
      const branchSearch = url.match(/\/([^\/]*)\/examples\//);
      const storageKey = 'ol-dismissed=-' + latestVersion;
      const dismissed = localStorage.getItem(storageKey) === 'true';
      if (branchSearch && !dismissed && /^v[0-9\.]*$/.test(branchSearch[1]) && '8.2.0' != latestVersion) {
        const link = url.replace(branchSearch[0], '/latest/examples/');
        fetch(link, { method: 'head' }).then(function (response) {
          const a = document.getElementById('latest-link');
          a.href = response.status == 200 ? link : '../../latest/examples/';
        });
        const latestCheck = document.getElementById('latest-check');
        latestCheck.style.display = '';
        document.getElementById('latest-dismiss').onclick = function () {
          latestCheck.style.display = 'none';
          localStorage.setItem(storageKey, 'true');
        }
      }
    });
  </script>
</body>

</html>